// 1.引入vue和vuerouter的包
import Vue from "vue";
import VueRouter from "vue-router";
// 2.调用vue.use函数，按插件
Vue.use(VueRouter)

//3.创建路由的实例对象
const router = new VueRouter({
  routes: [
    {path:'/',redirect:'/home'},
    { path:'/home',component:()=>import('@/components/Home.vue')},
    { path:'/movie/:id',component: ()=>import('@/components/Movie.vue')},
    { path:'/about',
    component: ()=>import('@/components/About.vue'),
    children: [
      { path:'tab1',component: ()=>import('@/components/tabs/Tab1.vue')},
      { path:'tab2',component: ()=>import('@/components/tabs/Tab2.vue')}
    ]
  },
  ]
});

// 4.导出路由实例对象
export default router

